<?php 
/**
 * **模型
 * @author 后盾马震宇 <houdunwangmzy@163.com>
 */
class AddressModel extends Model{
    public $table = 'address';
    
    public $validate = array(
		array('Uname','nonull','姓名不能为空',2,3),
		array('phone','nonull','手机号码不能为空',2,3),
		array('province','nonull','省份不能为空',2,3),
		array('address','nonull','地址不能为空',2,3)
	);
    
    /**
	 * 添加地址
	 */
	public function addData(){
	    if(!$this->create()) return false;
		$this->data['user_uid'] = $_SESSION['uid'];
		return $this->add();
	}
	
	/**
	 * 编辑地址
	 */
	public function editDate($atid){
	    if(!$this->create()) return false;
		return $this->where("atid={$atid}")->update();
	}
 }
 
 
 
 
 
 
 
 
 
 
 



 ?>